Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keeps the SyncEngine alive when the Wiredash widget updates #211

Merged
merged 1 commit into from
Jul 4, 2022

Conversation

passsy
Copy link
Member

@passsy passsy commented Jul 4, 2022

The SyncEngine (or better their jobs) depends on the WiredashApi. The WiredashApi depends on the Wiredash widget. When the Wiredash widget changes -because the secret or the projectId have might have changed - the WiredashApi gets recreated and so does the SyncEngine. Unfortunately, this cancels the inital sync where the engine waits 5s before firing the first jobs.

This fix makes sure the SyncEngine does not get recreated. It uses the same instance as long as Wiredash lives.

Why wasn't this caught with tests? Well it was tested. But in tests there is no dependency from the MockWireadshApi to the Wiredash Widget, thus not causing a rebuild. Sigh...

The SyncEngine (or better their jobs) depends on the WiredashApi. The WiredashApi depends on the Wiredash widget. When the Wiredash widget changes -because the secret or the projectId have might have changed - the WiredashApi gets recreated and so does the SyncEngine. Unfortunately, this cancels the inital sync where the engine waits 5s before firing the first jobs.

This fix makes sure the SyncEngine does not get recreated. It uses the same instance as long as Wiredash lives.

Why wasn't this caught with tests? Well it was tested. But in tests there is no dependency from the MockWireadshApi to the Wiredash Widget, thus not causing a rebuild. Sigh...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant